﻿using System;

namespace diantou.web.management
{
    /// <summary>
    /// 特判程序
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class problemSpecialProgram : permissionView<problemSpecialProgram>
    {
        /// <summary>
        /// 问题
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.dataAccess.problem problem;
        /// <summary>
        /// 用户OJ问题
        /// </summary>
        private onlineJudge.userProblem userProblem
        {
            get { return new onlineJudge.userProblem { Problem = problem, User = currentUser }; }
        }
        /// <summary>
        /// 是否正在提交代码
        /// </summary>
        private bool isSubmit;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="problemId"></param>
        /// <returns></returns>
        private bool loadView(int problemId)
        {
            problem = diantou.dataAccess.clientCache.Problem[problemId];
            if (problem != null)
            {
                if (currentUser.IsOnlineJudgeEditor(problem)) return true;
                problem = null;
                AjaxResponse(webConfig.NotFound404);
            }
            AjaxResponse(new fastCSharp.code.cSharp.webView.errorPath { ErrorPath = currentUser.Path.NewFocus });
            return false;
        }
    }
}